package com.ftg.learn.day09;

import java.io.Serializable;
import java.util.RandomAccess;

/**
 * @author kangjx
 * @version 1.0
 * @date 2023/8/3 下午2:15
 */
public interface MyMath {

    /**
     * 运算
     *
     * @param x 参数
     * @param y 参数
     * @return int
     */
    int computer(int x, int y);

    public static void main(String[] args) {
        //函数调用  类名：：方法
        MyMath m = Integer::sum;

        System.out.println(m.computer(3, 5));

        CreateCar car3 = Car::new;
        Car c3 = car3.create();

        CreateCar car = Car::new;
        Car car2 = car.create();
        //lambda 接口
        TestInter t1 = new TestInter() {
            @Override
            public String abc(Car c) {
                return c.getColor();
            }
        };

        TestInter t2 = (x) -> x.getColor();

        TestInter t = Car::getColor;

        String color = t.abc(new Car());

    }

}
